An interface or port lets your Mac communicate with other devices such as a
printer or modem. A serial port transfers data bits one after the other along a single
wire — this simplifies cable wiring and so reduces the cost.
ù Details about the Mac’s special Modem and Printer ports appear later in this section
Most domestic equipment uses asynchronous serial ports — data is sent in short bursts, usually one byte long. In this way the receiver’s reference timing doesn’t need to be particularly accurate — it can be derived from a simple crystal oscillator. Each byte consists of 8 bits, the least significant byte being sent first. In some cases only 7-bit data is transmitted, making the last bit available as a parity bit for simple error detection.
Various physical interfaces are used, including RS-232 and RS-422. Data is transferred between a port and the microprocessor itself by a Universal Asynchronous Receiver and Transmitter (UART) or Asynchronous Communications Interface Adaptor (ACIA) chip.
Speed
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Data can be transmitted at different speeds for different tasks. The speed is measured in bits per second (bit/s or bps), sometimes confused with baud rate which often isn’t the same thing. Common rates include:-
9.6 kbit/s is useful for a dot matrix printer since it’s actually faster than the device!
RS-232C Interface
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
This form of asynchronous port is also known as CCITT V.24. It’s commonly used to connect a modem (MODulator, DEModulator) or printer to a computer.
Although the data itself is sent along a single wire (with another for data going in the opposite direction) there are often a number of control circuits.
Connectors
Computers and printers are usually configured as Data Terminal Equipment (DTE). In theory they should have a 25 way D plug (DB25). In practice, most devices have a DB25 socket.
Modems are configured as Data Communication Equipment (DCE) — they’re invariably fitted with a DB25 socket.
The pin connections for a DTE fitted with a DB25 connector are:-
1 - Screen
2 TXD Transmitted data (output)
3 RXD Received data (input)
4 RTS Request to send (output)
5 CTS Clear to send (input)
6 DSR Data set ready (input)
7 OV Signal ground (Zero Volts)
8 DCD Data carrier detect (input)
9 - +volts
10 - -volts
11 - Spare
12 SDCD Secondary DCD (input)
13 SCTS Secondary CTS (input)
14 STXD Secondary TXD (output)
15 DCE Transmitter signal element timing (output)
16 SRXD Secondary RXD (input)
17 - Receiver signal element timing (input)
18 - Spare
19 SRTS Secondary RTS (output)
20 DTR Data terminal ready (output)
21 SQD Signal quality detector (input)
22 RI Ring indicator (input)
23 - Data signal rate detector (input)
24 DTE Transmitter signal element timing (input)
25 - Spare
 
External view of socket
The RS-232 interface on a LaserWriter provides only TXD, RXD, RTS, DTR and signal ground connections — the use of RTS and DTR may be optional.
Some equipment uses a 9 way D connector (DB9). For a DTE the connections are:-
2 RXD Received data (input)
3 TXD Transmitted data (output)
4 DTR Data terminal ready (output)
5 OV Signal ground (Zero Volts)
7 RTS Request to send (output)
8 CTS Clear to send (input)
 
External view of 9 way socket
The 25-way or 9-way connections for a DCE are identical to a DTE but the roles of input and output are reversed — inputs become outputs and vice versa.
Interconnecting Cables
A cable between a DTE and a DCE must be wired pin-for-pin. In some cases you must fit a plug at one end and socket at the other — other devices may require a plug at both ends. The cable screen (acting as an electrical shield around the other wires) and the signal ground (0V) circuits are usually connected at both ends.
A cable in which all conductors are wired is unlikely to cause complications but can be expensive. Varieties that only uses 5 or 8 wires are cheaper and work with most devices. The wiring is shown below (with the screen omitted for clarity):-
When a link uses software handshaking (see below) it’s possible to reduce the cable to just three wires — TXD, RXD and 0V.
It’s a bit more complicated if you need to join two DTEs or two DCEs — this requires a cable in which the data circuits are swapped. Always remember that the terms TXD and RXD refer to the function of the circuit as used in a conventional DTE to DCE link — not to their role as inputs and outputs. In other words you can have TXD inputs as well as outputs and RXD outputs as well as inputs!
For two DTEs the TXD output connection (pin 2) of device A must be joined to the RXD inputs (pin 3) on device B — and similarly in the opposite direction.When connecting two DCEs the RXD outputs (pin 3) must be joined to the TXD inputs (pin 2).
√π See the Serial Port Handshaking section for further details
RS-232 Data Representation
The RS-232 signal can be either at a positive or negative voltage. This can be anywhere in the range of 5 to 15 volts, although 12 volts is most commonly used. A level of -5 to -15 volts is known as a mark whilst +5 to +15 volts is a space.
Each burst of data appears as shown below:-
 
When at rest, when sending a logical 0 or when sending stop bits (at the end of each burst) the signal wire is at the negative voltage. When sending a logical 1 or a start bit (at the beginning of a data burst) the signal wire is at the positive voltage.
Some devices use 3 or 5 volt Transistor Transistor Logic (TTL) levels which can cause compatibility problems.
As for as the data itself the Least Significant Bit (LSB) is always sent first.
RS-423A Interface
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
This is also known as CCITT V.10. It’s similar to RS-232 but the common wire isn’t connected to ground at the receiver — instead it’s joined to a differential input. This avoids ground flow current problems so permitting it to work at 1 Mbit/s over 1,000 metres of cable or at 100 kbit/s over 10 metres. The lower transition voltage of 4 to 6 volts is usually compatible with RS-232.
RS-422 Interface
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
This balanced interface applies 5 volts alternately to one of two wires to indicate logical states. It can operate at 10 Mbit/s over 10 metres of cable or at 100 kbit/s over 1,000 metres.
It often appears on a 9 or 37 way D connector. The original Macs provided an RS-422 interface using a 9 way D connector (DB9) wired as follows:-
1 Shield Screen (joined to shell)
2 +5V Supply for external device
3 OV Signal ground (Zero Volts)
4 TXD+ Transmitted data (output)
5 TXD- Transmitted data (output)
6 +12V Supply for external device
7 CTS Clear to send (input)
8 RXD+ Received data (input)
9 RXD- Received data (input)
 
External view of 9 way socket
· RS-422 doesn’t use negative voltages — it won’t work reliably with RS-232 unless the
latter uses TTL voltages. The Mac’s serial port is an exception — linking the positive
wire an input pair to ground provides full RS-232 compatibility.
20 mA Loop Interface
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
This older type of interface is used in teleprinters and Telex machines. Logic 1 is represented by a flow of current, logic 0 is indicated by no current flowing.
· You’ll need an interface box to connect a 20 mA loop device to other serial ports.
Serial Port Handshaking
qqqqqqqqqqqqqqqqqqq
Handshaking is a protocol that allows two asynchronous devices to communicate their intention to send or ability to receive data. It provides a form of data flow control.
Two systems are used — hardware handshaking and software handshaking.
Hardware Handshaking
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
This uses extra handshake wires between the devices. It’s often essential when connecting between a Macintosh and modem working at 9.6 kbit/s or higher.
The two most common methods are:-
Request to Send (RTS) and Clear to Send (CTS)
This is the standard flow control for a DTE to DCE link. In this situation all the circuits in the interconnecting cable are wired pin for pin as shown below:-
The cable used to connect two DTEs is called a null-modem since no DCE (modem) is used. Several types of null-modem adaptor or cable can be used. The example shown below is suitable for RTS/CTS handshaking — this is provided by exchanging the RTS (output) and CTS (input) lines. The DTR outputs are linked to the DSR and DCD inputs to defeat any DTR handshaking (see below).
 
The following null-modem is designed for software handshaking (see below) in which the RTS and CTS circuits are linked out to defeat their handshaking effect. Once again the DTR outputs are linked to the DSR and DCD inputs to defeat DTR handshaking.
 
The null-modem shown below is intended for software handshaking with devices that lack DTR outputs. In this case the CTS outputs are used to set all three inputs:-
 
Data Terminal Ready (DTR)
DTR is used for flow control as a alternative to CTS. A high level on a DTR output indicates that the DTE is ready to accept data. In a standard DTE to DCE link all the circuits in the interconnecting cable are wired pin for pin as shown below:-
TXD _________________ TXD
RXD _________________ RXD
RTS _________________ RTS
CTS _________________ CTS
DSR _________________ DSR
DCD _________________ DCD
DTR _________________ DTR
0V _________________ 0V
For a null modem joining a DTE to DTE the following connections can be used to provide both CTS/RTS and DTR handshaking. The DTR outputs feed both the DSR and DCD inputs of the opposite device:-
 
The following configuration can be used where RTS/CTS handshaking isn’t used (usually when software handshaking is in operation) but where DTR control is still necessary. The RTS outputs are linked out to the CTS inputs of each device and to the other device’s DCD inputs:-
 
Software Handshaking
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
This uses additional codes within the data. Since these instructions must be handled by software some timing delays are inevitable. Software handshaking may be used in conjunction with hardware handshaking (see above) or on its own.
Systems include:-
XON/XOFF
This is the most common system. It may be necessary to link out the hardware handshake lines — by joining CTS to RTS, and possibly to any DTR inputs. The null modem cable used to connect two DTEs may be provided with such links.
XON, represented by an ASCII control code called DC1 (hex 11, Control-Q) tells the sender to suspend transmission. XOFF, represented by code DC3 (hex 14, Control-S) lets it resume.
Enquire/Acknowledge (ENQ/ACK)
This is an alternative system which is rarely encountered. The transmitter must check that the receiver is ready to accept data.
When the sender’s ready to transmit it puts out an ASCII control code called ENQ (hex 05, Control-E). If the receiver can accept a full data block it replies with ACK (hex 06, Control-F). The two devices must be initially set up to work with the same block size.
The Mac Printer and Modem Ports
qqqqqqqqqqqqqqqqqqqqqqqqq
  The Mac uses a Serial Port Controller (SCC) to transfer data between the processor
and its two ports. The ports comply to RS-422 — linking the positive wires to
ground gives full compatibility with RS-232.
· The modem port on recent Macs accepts a high-speed asynchronous modem.
· The handshake lines are unbalanced and use RS-232 levels.
The Mac Ports and Software
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
When using older software on some models you must use the Serial Switch control panel to slow up the ports — just select Slow/Compatible Mode. Having made the selection you can (optionally) remove the panel from the Control Panels folder in the System Folder.
The serial ports often default to 9.6 kbit/s and can always run at maximum rate of 57.6 kbit/s, although LocalTalk (and PhoneNet) work at 230.4 kbit/s — that’s 29 KB/s.
If the SerialDMA driver is added to a PowerMac or AV computer the maximum rate rises 230.4 kbit/s — but this prevents the use of hardware handshaking on the interface if it’s used as a PC port via DOS compatibility software.
The Mac’s serial ports can be used for a PC mouse (as designed for the COM1 or COM2 serial ports on a PC) if you have suitable adaptor cables and software.
Port Connections
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
The modem port uses an 8 way mini-DIN socket wired as shown below. The printer port is similar but some models doesn’t accept an external clock via the GPi pin, although it can be used as an optional DCD connection — the Mac Plus doesn’t have any GPi circuit.
When externally clocked the ports can operate at up to 920 kbit/s. Recent Apple Macs incorporate 9 way GeoPort sockets — these can be used with a GeoPort Telecom adaptor that works as a modem, speakerphone or answering machine. They can also accept any GeoPort compatible device, such as a modem or ISDN interface.
Pin Circuit RS-232 DTE Equivalent
  1 Handshake output (HSKo) RTS
2 Handshake input (HSKi) CTS
3 Transmitted Data (TXD-) TXD
4 Signal ground (Gnd) 0V
5 Received data (RXD-) RXD
6 Transmitted data (TXD+) Not used
7 General/external clock input (GPi) DCD ∆
8 Received data (RXD+) ◊
Plug case (Shield) Screen
◊ Normally linked to 0V at the RS-232 device
∆ The DCD connection may be optional
Most Apple devices are connected with a standard printer cable wired as follows:-
 
Where software handshaking is used the HSKo and HSKi circuits aren’t strictly necessary. If you’re really short of multi-way cable you can also omit the TXD+ and RXD+ wires over short distances. The GPi line is only used by special devices.
The earliest Macs used a 9 way D connector (DB9) for each serial port. The adaptor shown below converts the standard connector on a modern machine into this older form:-
Mini-DIN Plug 9 way D socket
 
This adaptor doesn’t provide the +5 or +12 volt circuits supplied on these machines.
Connecting to RS-232 Devices
A variety of adaptor cables are necessary to connect different RS-232 devices to the Mac. It’s advisable to link the RXD+ and Ground wires as shown in the diagrams. This ensures compatibility with RS-232 levels — although many devices will work without it.
The first example shows a cable that converts a Mac port into standard DTE device. You can use it to connect either port to a standard modem cable.
Mini-DIN plug 25 way D socket
 
The cable below is suitable for direct connection into most types of DCE modem:-
Mini-DIN plug 25 way D plug
 
The GPi line may not be required for some devices. With older Macs you must connect a synchronous modem to the modem port — the GPi pin must be connected.
The following adaptor is for a DTE printer, such as the original ImageWriter:-
Mini-DIN plug 25 way D plug
 
The Mac Apple Desktop Bus (ADB)
qqqqqqqqqqqqqqqqqqqqqqqqq
This 4.5 K per second synchronous bidirectional interface or bus allows several devices to be connected to a Mac at the some time. It can be used for keyboards, controllers, bar-code readers, optical character recognition (OCR) devices or even modems. It uses a 4 pin mini DIN plug, as used for Y/C connections on some video equipment, wired as follows
Pin Circuit
 
1 Data
2 Power key ◊
3 +5 volts
4 Ground
◊ Link 2 and 4 to simulate pressing the Power key
· Don’t connect an ADB device whilst the Mac is
powered — it shorts out the supply!
The total cable length on the bus shouldn’t exceed 5 metres and the supply current taken from the +5 volt supply should be 500 mA or less. A mouse takes 80 mA, a keyboard 25 to 80 mA. The supply may be protected by a black fuse on the motherboard of the Mac.
The bus can address up to 16 devices, including the Mac itself. You should avoid using any more than three devices at any one time — including any external keyboard or mouse but not including the keyboard or trackball inside a PowerBook computer.
If you have two devices, each with a single ADB socket you’ll need an ADB splitter cable to connect them. In some situations you may need to enable or disable specific ADB devices — you can do this with an ADB switch box, as long as you don’t move the switch whilst useful data is being transferred over the bus!
If you startup without any mouse connected the Mac may fail to respond to it when you plug it in! But you can risk changing the mouse after the Mac’s started with another one already connected.
A PowerBook must always use a low power ADB device — denoted by a D symbol. This means that you can’t use the extended version of Apple keyboard or other high power devices with these machines.
PowerPC Platform (PPCP) Macs will be fitted with a PS/2 interface, as used on PCs, instead of an ADB port. Some clones are supplied with both ADB and PS/2 interfaces.
Mac External Drive Connector
qqqqqqqqqqqqqqqqqqqqq
Older Macs provide for an external floppy disk drive via a 62.5 K per second serial interface, provided using an external 19 way D connector (DB19) or internal 20 way ribbon connector wired as follows:
19 Way D 20 Way Circuit
1 1 Ground
2 3 Ground
3 5 Ground
4 7 Ground
5 9 -12 volt ◊
6 11 +5 volt
7 13 +12 volt
8 15 +12 volt
- 17 +12 volt
- 19 +12 volt
9 - Not connected
10 20 Motor Speed Control •
11 2 Register select CA0
12 4 Register select CA1
13 6 Register select CA2
14 8 Register Write Strobe
15 10 Write Data Request
16 12 Control Line Select
17 14 Drive enable
18 16 Read data
19 18 Write data
◊ Not provided on Mac SE
• Not provided on Mac SE, may be connected to + 5 volt line
The power feed to the floppy is sometimes protected by a yellow fuse device on the motherboard. Some PowerBooks also use an external drive but via a different connector!
MIDI
qqqq
The Musical Instrument Digital Interface (MIDI) is used to connect computers to musical instruments and keyboards. Although the data is similar to RS-232 it employs an entirely different electrical interface.
8 bit data is sent without parity at 31.25 kbits/s (±1%) — about 3000 bytes per second. Earthing and interference problems are reduced by using a current loop to drive an opto-isolator in the receiver. In some cases these ‘optos’ can cause erratic behaviour as a result of timing errors — high speed versions can be used to overcome this.
Data travels in one direction only and without handshaking. If handshaking is essential a separate circuit must be used in each direction.
The Interface
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
MIDI uses a five-pole 180° socket conforming to the German DIN standard. The current loop itself uses pins 4 and 5 whilst pin 2 provides a screen circuit for the connecting cable. Pin 2 is connected to ground inside a device at Output and Thru sockets only.
 
 
The current flowing through the opto-isolator is interpreted as:-
no current = idle or logical 1
5 milliamp (mA) current flowing = logical 0
The Thru output replicates data at the Input socket — allowing you to daisy-chain up to three devices. Any more and you’ll get erratic results!
„ MIDI circuits should never be wired in parallel — a MIDI output can only feed one
input, but accidental connections don’t cause any damage!
A MIDI Thru Box can provide a reliable star distribution to a large number of devices. Two or more Output or Thru circuits can be sent to one destination by means of a MIDI merger.
Cables and Connectors
wwwwwwwwwww
Cables require a DIN plug at each end — with twisted-pair conductors for the connections to pins 4 and 5. The cable’s screen should be connected to pin 2 of each connector, but not to the plug cases. Special MIDI cables aren’t essential, especially over short distances — standard hi-fi cables are often adequate.
Pins 1 and 3 aren’t used by MIDI — but some manufacturers use them for other purposes. Try to use ready-made MIDI cables with all pins connected!
„ The wiring to pins 4 and 5 mustn’t be reversed!
With appropriate adaptors you can connect MIDI to audio XLR cables or jackfields that use 3-pole connectors — but keep MIDI away from audio circuits if you want to minimise interference!
The total length of a MIDI circuit shouldn’t exceed 15 metres. Low capacitance cable may work over a greater distance, but it’s not guaranteed! For really long distances you’ll need a MIDI to RS-422 and RS-422 to MIDI converter at the respective ends of the cable.